<?php
namespace Home\Controller;
use Think\Controller;

/**
 * 如果某个控制器必须用户登录才可以访问  
 * 请继承该控制器
 */
class BaseController extends Controller {
    public function _initialize(){
        $nav=M('category')->where('pid=0')->select();
        $this->assign('nav',$nav);
//        dd($nav);

        //轮播图
        $lunbo=M('lunbo')->where('status=1')->select();
        $this->assign('lunbo',$lunbo);

        //友情链接
        $links=M('links')->select();
        $this->assign('links',$links);

        //页面底部配置
        $footer=M("setting")->order('sort asc')->select();
        $this->assign('footer',$footer);
    }

}